Zadig 文档
Zadig
教程
博客
论坛
关于
中文英文
Zadig
教程
博客
论坛
关于
Zadig v4.2
Loading...
     编辑文档
     反馈问题
     社区讨论

    本页导航

    Multi-Service Shared Build

    This article introduces how to share a build configuration among multiple services, significantly reducing the management and maintenance burden of build scripts.

    # Configure Build

    Take multi-service-demo(opens new window) as an example. This project includes 3 Golang services service1/service2/service3, and the directory structure related to the build is as follows:

    ├── Dockerfile # Define the Dockerfile for 3 services
    ├── Makefile   # Define the compilation for 3 services
    ├── src        # The source code for 3 services
       ├── service1
       ├── service2
       └── service3
    
    1
    2
    3
    4
    5
    6

    # Step 1: Create a Build

    Create a Zadig build, select multiple services in the Service Selection section, and configure the build environment, code information, and general build scripts as needed. Use the system-provided variables to achieve build sharing. The build scripts in this example are as follows:

    cd zadig/examples/multi-service-demo
    make build-$SERVICE
    docker build -t $IMAGE -f Dockerfile --build-arg service=$SERVICE .
    docker push $IMAGE
    
    1
    2
    3
    4

    Shared Build

    # Step 2: Associate Services

    • When creating a build configuration, specify multiple services, or modify the build after creation and select multiple services in Service Selection.

    Use Shared Build

    • You can also choose to reuse existing build configurations as needed to achieve build sharing when configuring services.

    Reuse Existing Build When Creating a New Service

    # Configure Workflow

    Edit the "Build" task in the workflow, select the service and the corresponding build, and multiple services can share the same build.

    Configure Workflow

    ← Build ConfigurationUsing Build Templates→

    资源
    教程
    论坛
    博客
    公司
    关于
    客户故事
    加入我们
    联系我们
    微信扫一扫
    hello@koderover.com

    © 2026 筑栈(上海)信息技术有限公司 沪 ICP 备 19000177 号 - 1

    •  跟随系统
    •  浅色模式
    •  深色模式
    •  阅读模式